import { http } from "@/utils/http";
import { baseUrlApi } from "../utils";

//获取模块数据
type moduleList = {
  status: number;
  msg: string;
  data: [
    {
      EntityId: number;
      SelectItemId: number;
      CreateTime: null;
      ModificationTime: null;
      SelectType: string;
      SelectId: string;
      SelectName: string;
      SelectContent: string;
      SortNo: number;
    }
  ];
};
export type Answerlist = [
  {
    list2: [
      {
        list3: [
          {
            score: number;
            value1: string;
            value2: string;
            value3: string;
          }
        ];
        list4: [];
        list5: [];
        type2: string;
      }
    ];
    taskScore: string;
    type1: string;
  }
];

type Answer = {
  data: {
    list1: Answerlist;
    totalScore: string;
  };
  msg: string;
  status: number;
  success: boolean;
};
//获取模块数据
export const GetmoduleList = (params?: string) => {
  return http.request<any>(
    "get",
    baseUrlApi("/Common/GetSelectItemBySelectType?" + params)
  );
};

//获取答案数据

export const AnswerQuery = (data?: object) => {
  return http.request<Answer>("post", baseUrlApi("/Answer/AnswerQuery"), {
    data
  });
};
